<?php
$id=Yii::app()->request->getParam('id', 0);
$article=Article::model()->find('aid='.intval($id).' AND uid='.YII::app()->user->id.' AND cid=24');
if(empty($article)){
    $this->renderPartial('//site/error',array(
        'message'=>'此项隐藏功能,请从已发布的学术成就列表进入',
        'direct'=>$this->createUrl('manage/index',array('cate'=>9)),
    ));
    return;
}

$cs=Yii::app()->clientScript;
$cs->registerCoreScript('jquery');
$dir = Yii::getPathOfAlias('ext.ueditor');
$baseUrl = Yii::app()->getAssetManager()->publish($dir);
$cs->registerScriptFile($baseUrl.'/editor_all.js',CClientScript::POS_HEAD );
$cs->registerScriptFile($this->createUrl('site/ueditor', array('_'=>md5(rand(),rand()))),CClientScript::POS_HEAD );
$dir = Yii::getPathOfAlias('ext.ueditor.themes.default');
$baseUrl = Yii::app()->getAssetManager()->publish($dir);
$cs->registerCssFile($baseUrl.'/ueditor.css');
$cs->registerScript('ueditor', 'var ue = new UE.ui.Editor();ue.render(\'Article_content\');', CClientScript::POS_READY);
?>

<form method="post" action="<?php echo $this->createUrl('manage/upPost');?>">

    <div class="detailContent" style="min-height: 1335px">
        <table width="100%" cellspacing="0" cellpadding="0" border="0" class="table">
            <tbody><tr>
                <td>标题</td>
            </tr>
            <tr>
                <td><label for="textfield"></label>
                    <input type="text" id="Article_title" class="text" name="Article[title]" value="<?php echo $article->title;?>" /></td>
            </tr>

            <tr>
                <td>所属者</td>
            </tr>
            <tr>
                <td><label for="Article_author"></label>
                    <input type="text" id="Article_author" class="text" name="Article[author]"  value="<?php echo $article->author;?>" /><span class="msg" id="msg">所属者不能超过30个字符</span></td>
            </tr>

            <tr>
                <td>信息来源</td>
            </tr>
            <tr>
                <td><label for="Article_excerpt"></label>
                    <input type="text" id="Article_excerpt" class="text" name="Article[excerpt]" value="<?php echo $article->excerpt;?>" style="width: 460px;"/><span class="msg" id="msg"></span></td>
            </tr>

            <tr>
                <td>内容</td>
            </tr>
            <tr>
                <td><label for="textarea"></label>
                    <textarea rows="15" cols="80" class="texta400" id="Article_content" name="Article[content]"><?php echo $article->content;?></textarea></td>
            </tr>
            </tbody></table>
        <div class="sq paddingbotton80 paddingtop50">
            <input type="hidden" name="id" value="<?php echo $id;?>">
            <input type="hidden" name="cid" value="<?php echo 18;?>">
            <input id="button" type="submit" style="border: 0;height: 26px;" value="更新" />
        </div>
        <div class="clear"></div>
    </div>
</form>